import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JButton;


public class Bouton2 extends JButton {
 
        private String name;
        public Color gris = new Color (128, 128, 128,255);
        public Bouton2(String str){
                super(str);
                this.name = str;
        }
        
        public void paintComponent(Graphics g){
                
                Graphics2D g2d = (Graphics2D)g;
                
                GradientPaint gp = new GradientPaint(0, 0, gris, 0, this.getHeight(), Color.darkGray, true);
                g2d.setPaint(gp);
                g2d.fillRect(0, 0, this.getWidth(), this.getHeight());
                
                g2d.setColor(Color.black);
                g2d.drawString(this.name, this.getWidth() / 2 - (this.getWidth() / 2 /4), (this.getHeight() / 2) + 5);
                
        }
        
        
}